#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QProcess>
#include <QCloseEvent>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

    QString getSystem();

    QProcess *proc;
    bool detectedMaxThisRun;
    int runMax;

    void setRunningState(bool running);

    void readSettings();
    void writeSettings();


protected:
    void closeEvent(QCloseEvent *event);

private slots:
    void controlClicked_updateState();

    void browseForSave();
    void chooseObjSave();
    void chooseMcobj();

    void run_mcobj();

    void readFromMcobj();

    void finishedRun();
    void stopRun();
};

#endif // MAINWINDOW_H
